package com.woniu.woniu_bx.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.woniu.woniu_bx.groups.AddGroup;
import com.woniu.woniu_bx.groups.UpdateGroup;
import lombok.Data;
import org.apache.ibatis.annotations.Update;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Description 管理员表
 * @Author zhangjin
 * @Date 2022/8/27 15:13
 */
@TableName("bx_manager")
@Data
public class Manager {

    @Min(value = 1, groups = {UpdateGroup.class})
    @NotNull(groups = {UpdateGroup.class})
    @TableId(type = IdType.AUTO)
    private Integer id;

    @NotEmpty
    private String account;

    @NotEmpty
    private String password;

    @NotNull
    private Integer roleId;

    //N:锁定,Y:未锁定
    @NotEmpty(groups = {UpdateGroup.class})
    private String status;

    @TableField(exist = false)
    private String roleName;
}
